package com.zsrt.java.ex.annotation.demo05;

import static org.junit.Assert.*;

import java.lang.annotation.Annotation;

import org.junit.Test;

public class AnnotationTest {
	
	@Test
	public void testName() throws Exception {
		//获得类
		Class clazz=Class.forName("com.zsrt.java.ex.annotation.demo05.Student");
		//获取所有的注解
		Annotation[] annotations=clazz.getAnnotations();
		for(Annotation annotation:annotations){
			MyAnnotation myAnnotation=(MyAnnotation) annotation;
			System.out.println("value="+myAnnotation.value()+",num="+myAnnotation.num());
			
		}
		
	}

}
